<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../include/laypublic.jsp" %>
<%@ include file="../../include/vueComponent.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>项目信息收集新增</title>
</head>
<link rel="stylesheet" href="${ctx}/resources/vue-element-lib/detail.css">
<body>
<div id="app">
    <div class="layui-tab layui-tab-brief" lay-filter="xqxx-tab-all">
        <ul class="layui-tab-title">
            <li id="tbglId"
                <c:if test="${isAuditFlag eq '0'}">class="layui-this"</c:if> lay-id="0">项目跟踪详情
            </li>
            <li id="zgysId" lay-id="1">历史审批信息</li>
            <li id="zbwjfxId"
                <c:if test="${isAuditFlag eq '1'}">class="layui-this"</c:if> lay-id="2">审批信息
            </li>
        </ul>
        <div class="layui-tab-right">
            <template v-if="layId==0">
                <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="save(1)">保存</button>
                <button type="button" class="layui-btn layui-btn-radius" @click="save(2)">提交</button>
            </template>
            <c:if test="${isAuditFlag eq '1'}">
                <template v-if="layId==2">
                    <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="audit(0)">驳回
                    </button>
                    <button type="button" class="layui-btn layui-btn-radius" @click="audit(1)">通过</button>
                </template>
            </c:if>
        </div>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item <c:if test="${isAuditFlag eq '0'}">layui-show</c:if>">
                <div class="container">
                    <el-form ref="formRef" label-width="140px" label-suffix="："
                             label-position="left">
                        <%--项目基础信息--%>
                        <div class="title">
                            <h3>项目基础信息</h3>
                        </div>
                        <!--表单-->
                        <el-row>
                            <x-col>
                                <el-form-item label="项目编码">
                                    <span>{{info.proCode}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="所属公司">
                                    <span>{{info.compName}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目名称">
                                    <x-input v-model="info.proName" name="项目名称"/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="营销经理">
                                    <span>{{info.staffName}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="项目地点">
                                    <el-select v-model="info.refProvinceId" style="width: 100px" filterable
                                               placeholder="请选择"
                                               @change="selProvince">
                                        <el-option v-for="item in province" :key="item.id" :label="item.sname"
                                                   :value="item.id"></el-option>
                                    </el-select>

                                    <el-select v-model="info.refCityId" style="width: 100px" filterable
                                               placeholder="请选择"
                                               @change="selCity">
                                        <el-option v-for="item in city" :key="item.id" :label="item.sname"
                                                   :value="item.id"></el-option>
                                    </el-select>
                                    <el-select v-model="info.refAreaId" style="width: 100px" filterable
                                               placeholder="请选择"
                                               @change="selArea">
                                        <el-option v-for="item in area" :key="item.id" :label="item.sname"
                                                   :value="item.id"></el-option>
                                    </el-select>
                                    <el-input v-model="info.proAddress" placeholder="请输入内容"
                                              style="width: calc(100% - 312px)"></el-input>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目类型">
                                    <x-select v-model="info.proTypes" :options="projectType"
                                              name="项目类型"></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="入库情况">
                                    <x-select v-model="info.isInStore" :options="storageSituation"
                                              name="入库类型"></x-select>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目业态">
                                    <x-select v-model="info.proFormat" :options="proFormaType"
                                              name="入库类型"></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="运营周期">
                                    <x-input v-model="info.omYears" name="运营周期"/>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目渠道">
                                    <x-select v-model="info.fromChannel" :options="projectChannel"
                                              name="入库类型"></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="业主单位名称">
                                    <el-select v-model="info.unitId" style="width: 100%" filterable
                                               placeholder="请选择业主单位">
                                        <el-option v-for="item in owner" :key="item.id" :label="item.coopName"
                                                   :value="item.id"></el-option>
                                    </el-select>
                                    <%--                                <x-select v-model="info.unitId" :options="owner" name="入库类型"></x-select>--%>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="单位性质">
                                    <x-input v-model="info.coopProperty" name="单位性质"/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="内部关系">
                                    <x-input v-model="info.innerRelationship" name="内部关系"/>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="合作周期">
                                    <x-input v-model="info.workYears" name="合作周期"></x-input>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建设周期">
                                    <x-input v-model="info.buildYears" name="建设周期"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="总投资额">
                                    <x-input v-model="info.sumAmount" name="总投资额"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="项目简介" prop="remark">
                                    <x-input v-model="info.proRemarks" name="项目简介" type="textarea"
                                             :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <%--项目合作方--%>
                        <div class="title">
                            <h3>项目合作方</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_add">
                                <button class="layui-btn layuiadmin-btn-admin" type="button" data-type="add"
                                        @click="addSummary">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加合作单位
                                </button>
                            </div>
                            <div class="unit_center">
                                <div class="unit_img">
                                    <div class="item" v-for="(item,index) in summary" :key="index"
                                         v-if="summary.length>1">
                                        <img src="${ctx}/resources/images/del.png" alt="" @click="delSummary(index)">
                                    </div>
                                </div>
                                <el-table :data="summary" style="width: 100%" border>
                                    <el-table-column prop="unit" label="合作单位" align="center">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.sgCoopId" filterable placeholder="请选择"
                                                       style="width: 100%">
                                                <el-option v-for="item in coopInfoList" :key="item.id"
                                                           :label="item.coopName"
                                                           :value="item.id"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="effect" label="单位作用" align="center">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.coopEffect" filterable placeholder="请选择">
                                                <el-option v-for="item in coopEffect" :key="item.code"
                                                           :label="item.name"
                                                           :value="item.code"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="合作类型" align="center">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.cooperationType" filterable placeholder="请选择">
                                                <el-option v-for="item in cooperationType" :key="item.code"
                                                           :label="item.name"
                                                           :value="item.code"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </div>
                        </div>
                        <div class="title">
                            <h3>项目投资构成</h3>
                        </div>
                        <div class="investment">
                            <div class="investment_add">
                                <button class="layui-btn layuiadmin-btn-admin" type="button"
                                        @click.stop="addInvestment">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加子项
                                </button>
                            </div>
                            <div class="investment_top_del" v-if="itemName.length>1">
                                <div class="item"></div>
                                <div class="item" v-for="(item,index) in itemName" :key="index">
                                    <img src="${ctx}/resources/images/del.png" alt="" @click="delInvestmentTop(index)">
                                </div>
                            </div>
                            <div class="investment_center">
                                <div class="investment_img">
                                    <div class="item" v-for="(item,index) in investmentInfoVos" :key="index">
                                        <img src="${ctx}/resources/images/del.png" alt=""
                                             @click="delInvestmentLeft(index)"
                                             v-if="item.isAdd">
                                    </div>
                                </div>
                                <el-table :data="investmentInfoVos" style="width: 100%" border ref="investment">
                                    <el-table-column prop="name" label="名称" align="center">
                                        <template slot-scope="scope">
                                            <div v-if="scope.$index<=2||scope.row.name=='合计'">{{scope.row.name}}</div>
                                            <div v-else>
                                                <%--                                hover--%>
                                                <el-popover placement="bottom" width="50" trigger="hover"
                                                            style="opacity: 0">
                                                    <div class="el-popover_item">
                                                        <el-button type="button">添加费用</el-button>
                                                    </div>
                                                    <div class="el-popover_item">
                                                        <el-button type="button" @click="addInvestmentList(scope.row)">
                                                            添加子项
                                                        </el-button>
                                                    </div>
                                                    <div slot="reference">
                                                        <div style="cursor: pointer" v-if="!scope.row.isAdd">
                                                            {{scope.row.name}}
                                                        </div>
                                                        <el-input v-else v-model="scope.row.name"
                                                                  placeholder="请选择费用"></el-input>
                                                    </div>
                                                </el-popover>
                                            </div>
                                        </template>
                                    </el-table-column>
                                    <el-table-column align="center" v-for="(item,index) in itemName "
                                                     :key="index">
                                        <template #header>
                                            <el-input v-model="item.name" placeholder="请输入子项"></el-input>
                                        </template>
                                        <template slot-scope="scope">
                                            <template v-if="scope.row.name=='合计'">
                                                <el-input v-model="scope.row.list[index]" type="number" min="0"
                                                          placeholder="请输入金额"
                                                          @input="investmentTotal" :disabled="true"
                                                          style="color: #000"></el-input>
                                            </template>
                                            <template v-else>
                                                <el-input v-model="scope.row.list[index]" type="number" min="0"
                                                          placeholder="请输入金额"
                                                          @input="investmentTotal"></el-input>
                                            </template>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="type" label="合计" align="center" type="index" width="100">
                                        <template slot-scope="scope">
                                            <div v-if="scope.$index<=2"></div>
                                            <div v-else>{{scope.row.total?scope.row.total:'0'}}</div>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </div>
                        </div>
                        <%--回报机制--%>
                        <div class="repay">
                            <div class="title">
                                <h3>回报机制</h3>
                            </div>
                            <el-row>
                                <x-col position="full">
                                    <el-form-item label="" prop="b1">
                                        <el-radio-group v-model="info.backMech">
                                            <el-radio label="1">政府付费</el-radio>
                                            <el-radio label="2">可行性缺口补助</el-radio>
                                            <el-radio label="3">使用者付费</el-radio>
                                        </el-radio-group>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6" :offset="2" class="mr-10">
                                    <el-form-item label="工程费用下浮率">
                                        <x-input size="small" type="number" min="0" v-model="info.downRate"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="合理利润率">
                                        <x-input size="small" type="number" min="0" v-model="info.profitRate"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="投资回报率">
                                        <x-input size="small" type="number" min="0" v-model="info.investBackRate"/>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6" :offset="2" class="mr-10">
                                    <el-form-item label="折现率">
                                        <x-input size="small" type="number" min="0" v-model="info.discountRate"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="建设期融资利率">
                                        <x-input size="small" type="number" min="0" v-model="info.finRate"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="融资回报率">
                                        <x-input size="small" type="number" min="0" v-model="info.finBackRate"/>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6" :offset="2" class="mr-10">
                                    <el-form-item label="资本金回报率">
                                        <x-input size="small" type="number" min="0" v-model="info.capitalBackRate"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="总投资额">
                                        <x-input size="small" type="number" min="0" v-model="info.sumAmount"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="资本金比例">
                                        <x-input size="small" type="number" min="0" v-model="info.capitalPercent"/>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="6" :offset="2" class="mr-10">
                                    <el-form-item label="资本金数额">
                                        <x-input size="small" type="number" min="0" v-model="info.capitalFund"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="我方股权出资金额">
                                        <x-input size="small" type="number" min="0" v-model="info.stockFund"/>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6" class="mr-10">
                                    <el-form-item label="我方股权比例">
                                        <x-input size="small" type="number" min="0" v-model="info.stockPercent"/>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </div>
                        <div class="title">
                            <h3>项目其他信息</h3>
                        </div>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="项目优点">
                                    <x-input v-model="info.proMerit" type="textarea" :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="其他说明">
                                    <x-input v-model="info.proOthers" type="textarea" :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <template v-if="standardTable&&standardTable.length>0">
                            <div class="title">
                                <h3>底线标准情况</h3>
                            </div>
                            <div class="unit">
                                <div class="unit_center">
                                    <el-table :data="standardTable" style="width: 100%" border>
                                        <el-table-column prop="standardName" label="标准名称"
                                                         align="center"></el-table-column>
                                        <el-table-column prop="standardCode" label="标准值"
                                                         align="center"></el-table-column>
                                        <el-table-column prop="nowProgress" label="当前进度"
                                                         align="center"></el-table-column>
                                        <el-table-column prop="resultMsg" label="结论" align="center"></el-table-column>
                                    </el-table>
                                </div>
                            </div>
                        </template>
                        <div class="title">
                            <h3>项目附件信息</h3>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">项目可研报告</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" type="button" id="1-upload-more">上传</button>
                                    <div class="layui-upload-list" id="1-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">两评一案</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" type="button" id="2-upload-more">上传</button>
                                    <div class="layui-upload-list" id="2-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">其他资料</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" type="button" id="3-upload-more">上传</button>
                                    <div class="layui-upload-list" id="3-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <%--跟踪信息列表--%>
                        <div class="title">
                            <h3>跟踪信息列表</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_center">
                                <el-table :data="trackList" style="width: 100%" border>
                                    <el-table-column prop="addTime" label="跟踪日期" align="center"></el-table-column>
                                    <el-table-column label="跟踪来源" align="center">
                                        <template slot-scope="scope">
                                            <span v-if="scope.row.proStage==1">跟踪阶段</span>
                                            <span v-else-if="scope.row.proStage==2">立项阶段</span>
                                            <span v-else-if="scope.row.proStage==3">资审阶段</span>
                                            <span v-else-if="scope.row.proStage==4">投标阶段</span>
                                            <span v-else-if="scope.row.proStage==5">开标阶段</span>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="srealName" label="跟踪人" align="center"></el-table-column>
                                    <el-table-column prop="todayMemo" label="进展情况" align="center"></el-table-column>
                                    <el-table-column prop="tomorrowPlan" label="最新进展" align="center"></el-table-column>
                                    <%--                                    <el-table-column prop="type" label="处理决策" align="center"></el-table-column>--%>
                                    <%--                                    <el-table-column prop="type" label="附件" align="center"></el-table-column>--%>
                                </el-table>
                            </div>
                        </div>

                        <%--项目最新进展--%>
                        <div class="title">
                            <h3>项目最新进展</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_add">
                                <button class="layui-btn layuiadmin-btn-admin" type="button" data-type="add"
                                        @click="addProgressArr">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加难点、卡点
                                </button>
                            </div>
                            <div class="unit_center">
                                <div class="unit_img">
                                    <div class="item" v-for="(item,index) in progressArr" :key="index"
                                         v-if="progressArr.length>1">
                                        <img src="${ctx}/resources/images/del.png" alt="" @click="delProgressArr(index)"
                                             v-if="item.add"/>
                                    </div>
                                </div>

                                <el-table :data="progressArr" style="width: 100%" border>
                                    <el-table-column label="项目推进存在难点、卡点" align="center">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.keyPoints"
                                                      placeholder="项目推进存在难点、卡点"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="解决思路与措施" align="center">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.solveWay" placeholder="解决思路与措施"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="需要集团协助事项" align="center">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.needSupport" placeholder="需要集团协助事项"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="最新回复" align="center">
                                        <%--template slot-scope="scope">
                                            <el-input v-model="scope.row.latestReply" placeholder="最新回复"></el-input>
                                        </template>--%>
                                    </el-table-column>
                                    <el-table-column prop="type" label="操作" align="center" width="100">
                                    </el-table-column>
                                </el-table>
                            </div>
                        </div>
                        <div class="title">
                            <h3>项目风险</h3>
                        </div>
                        <div class="unit">
                            <div class="unit_add">
                                <button class="layui-btn layuiadmin-btn-admin" type="button" data-type="add"
                                        @click="addRisk">
                                    <i class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加风险点
                                </button>
                            </div>
                            <div class="unit_center">
                                <div class="unit_img">
                                    <div class="item" v-for="(item,index) in riskTable" :key="index"
                                         v-if="riskTable.length>1">
                                        <img src="${ctx}/resources/images/del.png" alt="" @click="delRisk(index)"
                                             v-if="item.add"/>
                                    </div>
                                </div>
                                <el-table :data="riskTable" style="width: 100%" border>
                                    <el-table-column label="风险描述" align="center">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.riskDesc" placeholder="请输入风险点"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="风险等级" align="center">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.riskLevel" placeholder="请选择">
                                                <el-option v-for="item in riskLevel" :key="item.code" :label="item.name"
                                                           :value="item.code"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="处理策略" align="center">
                                        <template slot-scope="scope">
                                            <el-select v-model="scope.row.solveWay" placeholder="请选择">
                                                <el-option v-for="item in riskSolveWay" :key="item.code"
                                                           :label="item.name"
                                                           :value="item.code"></el-option>
                                            </el-select>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="最新进展" align="center">
                                        <template slot-scope="scope">
                                            <el-input v-model="scope.row.latestProgress"
                                                      placeholder="请描述风险进展"></el-input>
                                        </template>
                                    </el-table-column>
                                    <el-table-column label="操作" align="center" width="100">
                                        <template slot-scope="scope">
                                            <div @click="output(scope.row.id)" style="cursor: pointer;color: #2f9688"
                                                 v-if="!scope.row.add">销项
                                            </div>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </div>
                        </div>
                        <%-- 项目最新进展--%>
                        <div class="title">
                            <h3>项目最新进展</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="项目重要等级">
                                    <span>{{proTrack.proLevel}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="跟踪人员">
                                    <span>{{proTrack.addBy}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="跟踪日期">
                                    <span>{{proTrack.addTime}}</span>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="项目阶段">
                                    <span>{{proTrack.proStage}}</span>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="推进情况">
                                    <x-input v-model="proTrack.todayMemo" type="textarea" :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="后续推进计划">
                                    <x-input v-model="proTrack.tomorrowPlan" type="textarea" :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>项目附件信息</h3>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">附件信息</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <button type="button" class="layui-btn" type="button" id="43-upload-more">上传
                                    </button>
                                    <div class="layui-upload-list" id="43-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <%--审批信息--%>
                        <%--  <div class="title">
                              <h3>审批信息</h3>
                          </div>
                          <div class="approve">
                              <el-row>
                                  <x-col position="left">
                                      <el-form-item label="是否继续跟踪">
                                          <x-select v-model="info.isTrack" name="继续跟踪" :options="traceOptions"></x-select>
                                      </el-form-item>
                                  </x-col>
                                  <x-col position="full">
                                      <el-form-item label="审批意见">
                                          <x-input v-model="info.applyOpinion" type="textarea" :rows="4"></x-input>
                                      </el-form-item>
                                  </x-col>
                              </el-row>
                          </div>--%>
                    </el-form>
                </div>
            </div>
        </div>
    </div>
</div>

<%--<div id="app">
    <div class="head">
        <div class="left">项目跟踪详情</div>
        <div class="right">
            <button type="button" class="layui-btn layui-btn-primary layui-btn-radius" @click="save(1)">保存</button>
            <button type="button" class="layui-btn layui-btn-radius" @click="save(2)">提交</button>
        </div>
    </div>
</div>--%>
<script src="${ctx}/resources/vue-element-lib/jquery.js"></script>
<script>
    let fileArr = [];
    var staticPath = '${fileHttpPre}';
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'table', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , upload = layui.upload
            , table = layui.table
            , element = layui.element
            , layer = layui.layer;

        if ("${isAuditFlag}" === "1") {
            vm.$data.layId = 2;
        }
        //选项卡切换监听
        element.on('tab(xqxx-tab-all)', function (data) {
            var layId = $(this).attr('lay-id');
            vm.$data.layId = layId
            if (layId === "0") {
            } else if (layId === "1") {
                loadTable(layId);
            } else if (layId === "2") {
            }
        });

        function loadTable(layId) {
            // 表单
            table.render({
                elem: '#lay-lsspxx-create-manage'
                , url: basePath + '/historyProcess/list?proCode=${proCode}'
                , cols: [[
                    {
                        field: 'startTime', title: '发起时间', width: 145, width: 155, templet: function (d) {
                            return layui.util.toDateString(d.startTime, "yyyy-MM-dd HH:mm:ss");
                        }
                    }
                    , {field: 'startRealName', title: '发起人', width: 145}
                    , {field: 'proFlowType', title: '审批阶段', width: 145}
                    , {field: 'proFlowNode', title: '审批节点', width: 145}
                    , {
                        field: 'dealTime', title: '审批日期', width: 155, templet: function (d) {
                            return layui.util.toDateString(d.dealTime, "yyyy-MM-dd HH:mm:ss");
                        }
                    }
                    , {field: 'dealName', title: '审批人', width: 160}
                    , {
                        field: 'state', title: '审批状态'
                    }
                    , {
                        title: '操作', width: 140, align: 'center', fixed: 'right', templet: function (d) {
                            var optStr = "";
                            optStr += '<a class="layui-btn layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-form"></i>查看</a>';
                            return optStr;
                        }
                    }
                ]]
                , page: true
                , limit: 10
            });

            // 监听操作列
            table.on('tool(lay-lsspxx-create-manage)', function (obj) {
                var data = obj.data;
                if (obj.event === 'view') {//查看
                    parent.layui.index.openTabsPage(basePath + '/historyProcess/toDetail?processId=' + data.processId, '历史流程信息 > 详情');
                }
            });
        }
        ;(function () {
            //定义构造函数
            var Upfile = function (ele, type, opt) {
                this.defaults = {
                    //elem:‘#uploadPic‘	//绑定元素
                    elem: $(ele)	//绑定元素
                    , url: basePath + '/contractInfo/uploadAtt/',
                    data: {
                        types: type
                    },
                    multiple: true,
                    accept: 'file',
                    acceptMime: 'application/zip,application/x-rar-compressed,image/jpeg,image/png,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf',

                    method: 'post',
                    before: function (obj) { //obj参数包含的信息
                        layer.load(); //上传loading
                    },
                    done: function (res) {
                        //如果上传失败
                        if (res.code > 0) {
                            layer.closeAll('loading'); //关闭loading
                            return layer.msg(res.msg, {icon: 7});
                        }
                        //上传完毕
                        if (res.entity != null && res.entity.length > 0) {
                            fileArr.push(res.entity[0])
                            for (var i in res.entity) {
                                var contractInfo = res.entity[i];
                                var arr = contractInfo.split("|");
                                var imgSrc = "";
                                var suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                                if (suffix == 'jpg' || suffix == 'png') {
                                    imgSrc = "${fileHttpPre}/" + arr[3];
                                } else {
                                    imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                                }
                                $('#' + type + '-upload-more-list')
                                    .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                        + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                        + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                        + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                        + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                            }
                        }
                    },
                    allDone: function (obj) { //当文件全部被提交后，才触发
                        layer.closeAll('loading'); //关闭loading
                    },
                    error: function () {
                        layer.closeAll('loading'); //关闭loading
                        //上传失败
                        layer.msg("上传失败，请稍后再试~", {icon: 7});
                    }
                }
                this.options = $.extend({}, this.defaults, opt);
            };

            //定义方法
            Upfile.prototype = {
                init: function () {
                    var _this = this;
                    return layui.use('upload', function () {
                        var upload = layui.upload;

                        //执行实例
                        var uploadInst = upload.render(_this.options);
                    });
                }
            };

            //在插件中使用对象
            $.fn.upfile = function (options) {
                var upfile = new Upfile(this, options);
                return upfile.init();
            }
        })();
        //上传文件
        $('#1-upload-more').upfile(1);
        $('#2-upload-more').upfile(2);
        $('#3-upload-more').upfile(3);
        $('#43-upload-more').upfile(43);
    });

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
        fileArr.map((el, idx) => {
            if (el.split('|')[2] == index) {
                fileArr.splice(idx, 1)
            }
        })
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    /*核心*/
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                layId: '0',
                procNodeList: [],
                tempNodeList: [],
                auditMsg: '',//审批意见
                proCode: '',
                id: '',
                options: [],
                info: {
                    proName: '',//项目名称
                    proTypes: '',//项目类型
                    isInStore: '',//入库情况
                    proFormat: '',//项目业态
                    omYears: '',//运营周期
                    refProvinceId: '',//省 id
                    refCityId: '',//市 id
                    refAreaId: '',//区id
                    proAddress: '',//详细地址
                    innerRelationship: '',//内部关系
                    coopProperty: '',//单位性质
                    unitId: '',//业主单位Id
                    fromChannel: '',//项目渠道
                    workYears: '',//合作周期
                    buildYears: '',//建设周期
                    sumAmount: '',//总投资额
                    proRemarks: '',//项目简介
                    //回报机制
                    downRate: '',//工程费用下浮率
                    profitRate: '',//合理利润率
                    investBackRate: '',//投资回报率
                    discountRate: '',//折现率
                    finRate: '',//建设期融资利率
                    finBackRate: '',//融资回报率
                    capitalBackRate: '',//资本金回报率
                    capitalPercent: '',//资本金比例
                    capitalFund: '',//资本金数额
                    stockFund: '',//我方股权出资金额
                    stockPercent: '',//我方股权比例
                    //项目风险
                    proMerit: '',//项目优点
                    proOthers: '',//其他说明
                    isTrack: '',//是否继续追踪
                    applyOpinion: '',//审批意见


                    backMech: '',
                },
                coopInfoList: [],//合作单位
                coopEffect: [],//单位作用
                cooperationType: [],//合作类型
                proFormaType: [],//项目业态
                projectChannel: [],//项目渠道
                projectType: [],//项目类型
                riskLevel: [],//风险等级
                storageSituation: [],//入库情况
                province: [],//省
                city: [],//市
                area: [],//区
                summary: [],//合作单位 sgCoopId 合作单位ID---coopEffect 单位作用 --- setCooperationType --合作类型

                riskSolveWay: [],//处理策略
                //项目类型
                projectType: [],
                //入库情况
                storageSituation: [],

                // 是否追踪
                traceOptions: [
                    {name: '继续跟踪', code: 0},
                    {name: '停止跟踪', code: 1}
                ],
                summary: [], // sgCoopId 合作单位ID---coopEffect 单位作用 --- setCooperationType --合作类型

                itemName: [{name: '子项名称1'},],
                investmentInfoVos: [
                    {name: '合作周期', list: [0], total: 0,},
                    {name: '建设周期', list: [0], total: 0,},
                    {name: '运营周期', list: [0], total: 0,},
                    {name: '1.建安工程费用', list: [0], total: 0,},
                    {name: '2.设备购置费用', list: [0], total: 0,},
                    {name: '3.工程建设其他', list: [0], total: 0,},
                    {name: '3.1征地拆迁费', list: [0], total: 0,},
                    {name: '4.预备费', list: [0], total: 0,},
                    {name: '5.建设期利息', list: [0], total: 0,},
                    {name: '合计', list: [0], total: 0,}],
                owner: [],      //业主单位
                //项目风险点
                riskTable: [],//riskDesc:风险描述 riskLevel:等级 solveWay:处理策略 latestProgress:最新进展
                //底线标准情况
                standardTable: [],//name:标准名称 value:标准值 schedule:当前进度  conclusion:结论
                proTrack: {},//项目最新进展
                progressArr: [],
                trackList: [],//跟踪信息列表
                showFlag: '',
            }
        },
        created() {
            let that = this;
            this.getDrop();//获取下拉
            this.getAddress()//获取地址
            this.queryCoopInfo();//获取业主单位
            that.proCode = "${proCode}";
            that.processId = "${processId}";
            that.id = "${id}";
            that.showFlag = "${showFlag}";
            console.log(that.showFlag)

            if (that.proCode && that.proCode != 'undefined') {
                that.queryCollectDetail();
                that.proTrackPage();
                that.proTrackDevelop();
                that.queryTrackRisk();
                that.queryProcessList();
            } else {
                if (that.id) {
                    $.ajax({
                        type: 'post',
                        url: basePath + '/proTrack/queryProCode',  //请求数据接口
                        data: {
                            id: that.id
                        },
                        success: function (result) {
                            console.log(result)
                            that.proCode = result;
                            if (that.proCode && that.proCode != 'undefined') {
                                that.queryCollectDetail();
                                that.proTrackPage();
                                that.proTrackDevelop();
                                that.queryTrackRisk();
                                that.queryProcessList();
                            }
                        }
                    });
                }
            }
        },
        mounted() {

        },
        methods: {

            // 查看详情
            queryCollectDetail() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proTrack/queryCollectDetail',  //请求数据接口
                    data: {
                        proCode: that.proCode
                    },
                    success: function (result) {
                        that.info = result.entity.projectInfo;
                        that.info.isTrack = Number(that.info.isTrack);
                        that.getAddress(that.info.refProvinceId, 1)//获取地址
                        that.getAddress(that.info.refCityId, 2)//获取地址
                        that.riskTable = result.entity.riskTable;
                        that.summary = result.entity.summaryCoops;
                        that.proTrack = result.entity.proTrack;
                        let arr = [];
                        that.summary.map((el, index) => {
                            if (el.coopEffect == -1) {
                                arr = that.summary.splice(index, 1)
                            }
                        })
                        that.info.unitId = arr && arr.length > 0 ? arr[0].sgCoopId : '';
                        that.showFile(result.entity.fileAtt);
                        if (result.entity.investmentInfoVos.length > 0) {
                            that.itemName = result.entity.itemName;
                            that.investmentInfoVos = result.entity.investmentInfoVos;
                        }
                        if (result.entity.standardTable.length > 0) {
                            that.standardTable = result.entity.standardTable;
                        }
                        // if (that.info.refAreaId) {
                        //     that.getStandard();
                        // }
                    }
                });
            },
            output(e) {
                console.log(e);
                let that = this;
                this.$confirm('确认将该风险点销项吗?', '温馨提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: 'post',
                        url: basePath + '/projectRisk/editRiskById',
                        data: {
                            id: e,
                        },
                        success: function (result) {
                            that.queryTrackRisk();
                            that.$message({
                                type: 'success',
                                message: '删除成功!'
                            });
                        }
                    });

                }).catch(() => {
                });
            },
            //跟踪信息列表
            proTrackPage() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proTrack/proTrackPage',
                    data: {
                        proCode: that.proCode,

                    },
                    success: function (result) {
                        console.log(result.data)
                        if (result.data[0] != null) {
                            that.trackList = result.data;
                        }
                    }
                });
            },
            //最新进展
            proTrackDevelop() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proTrack/proTrackDevelop',
                    data: {
                        proCode: that.proCode,

                    },
                    success: function (result) {
                        if (result.success) {
                            that.progressArr = result.entity
                        }

                    }
                });
            },
            //项目风险列表
            queryTrackRisk() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/projectRisk/queryTrackRisk',
                    data: {
                        proCode: that.proCode,
                    },
                    success: function (result) {
                        if (result.success) {
                            that.riskTable = result.entity
                        }
                    }
                });
            },
            //获取所有业主单位
            queryCoopInfo() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proSell/queryCoopInfo',  //请求数据接口
                    data: {},
                    success: function (result) {
                        that.owner = result;
                    }
                });
            },
            //获取底线标准情况
            /*     getStandard() {
                     console.log(this.info.refProvinceId)
                     let that = this;
                     let id = (that.info.refProvinceId ? that.info.refProvinceId + ',' : '') + (that.info.refCityId ? that.info.refCityId + ',' : '') + (that.info.refAreaId ? that.info.refAreaId + ',' : '')
                     $.ajax({
                         type: 'post',
                         url: basePath + '/baseLine/getStandard',  //请求数据接口
                         data: {
                             address: id
                         },
                         success: function (result) {
                             that.standardTable = result;
                         }
                     });
                 },*/
            //展示文件
            showFile(fileList) {
                if (fileList && fileList.length > 0) {
                    fileArr = fileList;
                    for (let i in fileList) {
                        let contractInfo = fileList[i];
                        let arr = contractInfo.split("|");
                        let imgSrc = "";
                        let suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#' + arr[0] + '-upload-more-list')
                            .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                    }
                }
            },
            // 错误提示
            error(text) {
                this.$message({
                    message: text,
                    type: 'warning'
                });
            },
            //获取下拉
            getDrop() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/collectProject/getDrop',  //请求数据接口
                    data: {},
                    success: function (result) {
                        that.coopInfoList = result.entity.coopInfoList;//合作单位
                        that.coopEffect = result.entity.coopEffect;//单位作用
                        that.cooperationType = result.entity.cooperationType;//合作类型
                        that.proFormaType = result.entity.proFormaType;//项目业态
                        that.projectChannel = result.entity.projectChannel;//项目渠道
                        that.projectType = result.entity.projectType;//项目类型
                        that.riskLevel = result.entity.riskLevel;//风险等级
                        that.riskSolveWay = result.entity.riskSolveWay;//风险等级
                        that.storageSituation = result.entity.storageSituation;//入库情况

                    }
                });
            },
            //获取地址
            getAddress(id, type = 0) {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/collectProject/getAddress',  //请求数据接口
                    data: {
                        id: (id ? id + ',' : '') + (type ? type : '0')
                    },
                    success: function (result) {
                        if (type == 0) {
                            that.province = result.entity;//省
                        } else if (type == 1) {
                            that.city = result.entity//市
                        } else {
                            that.area = result.entity//区
                            // if (that.area.length < 2) {
                            //     that.getStandard();
                            // }
                        }
                    }
                });
            },
            //选择省
            selProvince(id) {
                this.city = [];
                this.area = [];
                this.info.refCityId = '';//市 id
                this.info.refAreaId = '';//区id
                this.info.proAddress = '';//详细地址
                this.getAddress(id, 1)//获取地址
            },
            //选择市
            selCity(id) {
                this.area = [];
                this.info.refAreaId = '';//区id
                this.info.proAddress = '';//详细地址
                this.getAddress(id, 2)//获取地址
            },
            //选择区
            selArea() {
                /*if (this.info.refAreaId) {
                    this.getStandard();
                }*/
            },
            //添加合作单位
            addSummary() {
                let obj = {
                    sgCoopId: '',
                    coopEffect: '',
                    cooperationType: ''
                }
                this.summary.push(obj);
            },
            //删除合作单位
            delSummary(index) {
                this.summary.splice(index, 1)
            },
            //删除子项
            delInvestmentTop(index) {
                this.itemName.splice(index, 1);
                this.investmentInfoVos.map(el => {
                    el.list.splice(index, 1);
                })
                this.investmentTotal();
            },
            delInvestmentLeft(index) {
                this.investmentInfoVos.splice(index, 1);
                this.investmentTotal();
            },
            addInvestment() {
                if (this.itemName.length < 6) {
                    this.itemName.push({name: ''});
                    this.investmentInfoVos.map(el => {
                        el.list.push(0);
                    })
                }
            },
            //合计 计算数字
            () {
                //计算每一列的相加
                let arr1 = [];
                this.investmentInfoVos.map((el, idx) => {
                    if (el.name != '合计' && idx > 2) {
                        el.list.map((el1, index) => {
                            if (!arr1[index]) {
                                arr1[index] = 0;
                                arr1[index] = arr1[index] + Number(el1)
                            } else {
                                arr1[index] = arr1[index] + Number(el1)
                            }
                        })
                    }
                    if (el.name == '合计') {
                        el.list = arr1
                    }
                })
                let sum = 0;
                // 计算每一行的总和
                this.investmentInfoVos.map((el, idx) => {
                    let num = 0;
                    el.list.map(el1 => {
                        num += Number(el1) ? Number(el1) : 0
                    })
                    el.total = num ? num : 0;
                    if (el.name != '合计' && idx > 2) {
                        sum += el.total;
                    } else {
                        el.total = sum
                    }
                })
            },
            addInvestmentList(e) {
                for (let x in this.investmentInfoVos) {
                    if (this.investmentInfoVos[x].name == e.name) {
                        let obj = {
                            name: '',
                            list: [],
                            total: 0,
                            isAdd: true,
                        }

                        this.itemName.map(el => {
                            let num = 0
                            obj.list.push(num)
                        })
                        this.investmentInfoVos.splice(Number(x) + 1, 0, obj)
                    }
                }
            },
            //添加风险点
            addRisk() {
                let obj = {description: '', grade: '', strategy: '', progress: '', add: true};
                this.riskTable.push(obj);
            },
            //删除风险点
            delRisk(index) {
                this.riskTable.splice(index, 1)
            },

            //添加项目最新进展
            // keyPoints项目推进存在难点、卡点  solveWay解决思路与措施 needSupport需要集团协助事项
            addProgressArr() {
                let obj = {keyPoints: '', solveWay: '', needSupport: '', add: true};
                this.progressArr.push(obj);
            },
            //删除项目最新进展
            delProgressArr(index) {
                this.progressArr.splice(index, 1)
            },
            //保存
            save(type) {
                let that = this;
                if (that.info.proName == '') return that.error('请选择项目名称');
                if (that.info.refProvinceId == '') return that.error('请选择省');
                if (that.info.refCityId == '') return that.error('请选择市');
                // if (that.info.refAreaId == '') return that.error('请选择区');
                if (that.info.proAddress == '') return that.error('请输入详细地址');
                if (that.info.proTypes == '') return that.error('请选择项目类型');
                if (that.info.isInStore == '') return that.error('请选择入库情况');
                if (that.info.proFormat == '') return that.error('请选择项目业态');
                if (that.info.omYears == '') return that.error('请输入运营周期');
                if (that.info.fromChannel == '') return that.error('请选择项目渠道');
                // if (that.info.unitId == '') return that.error('请选择业主单位');
                if (that.info.coopProperty == '') return that.error('请选择单位性质');
                if (that.info.innerRelationship == '') return that.error('请输入内部关系');
                if (that.info.workYears == '') return that.error('请输入合作周期');
                if (that.info.buildYears == '') return that.error('请输入建设周期');
                if (that.info.sumAmount == '') return that.error('请输入总投资额');
                if (that.info.proRemarks == '') return that.error('请输入项目简介');
                if (that.info.downRate == '') return that.error('请输入工程费用下浮率');
                if (that.info.profitRate == '') return that.error('请输入合理利润率');
                if (that.info.investBackRate == '') return that.error('请输入投资回报率');
                if (that.info.discountRate == '') return that.error('请输入折现率');
                if (that.info.finRate == '') return that.error('请输入建设期融资利率');
                if (that.info.finBackRate == '') return that.error('请输入融资回报率');
                if (that.info.capitalBackRate == '') return that.error('请输入资本金回报率');
                if (that.info.capitalPercent == '') return that.error('请输入资本金比例');
                if (that.info.capitalFund == '') return that.error('请输入资本金数额');
                if (that.info.stockFund == '') return that.error('请输入我方股权出资金额');
                if (that.info.stockPercent == '') return that.error('请输入我方股权比例');
                if (that.info.proMerit == '') return that.error('请输入项目优点');
                if (that.info.proOthers == '') return that.error('请输入其他说明');
                // if (that.info.isTrack === '') return that.error('请选择是否继续追踪');
                // if (that.info.applyOpinion == '') return that.error('请输入审批意见');
                if (that.info.backMech == '') return that.error('请选择回报机制');
                let obj = {
                    'id': that.id || null,
                    "trackInfo": that.proTrack,
                    "summary": that.summary,  //合作方信息
                    "projectInfo": that.info,//项目基础信息
                    "itemName": that.itemName,//项目子项信息
                    "investmentInfoVos": that.investmentInfoVos,//投资构成信息
                    "projectRisk": that.riskTable,//项目风险信息
                    "fileAtt": fileArr,//附件信息
                    "proProgresses": that.progressArr
                }
                //上传所有addTime 为空
                if (obj.projectInfo.addTime) {
                    obj.projectInfo.addTime = null;
                    obj.projectInfo.uptTime = null;
                }
                obj.summary.map(el => {
                    if (el.addTime) {
                        el.addTime = null;
                        el.uptTime = null;
                    }
                })
                obj.projectRisk.map(el => {
                    if (el.addTime) {
                        el.addTime = null;
                        el.uptTime = null;
                    }
                })
                let str = JSON.stringify(obj).replace(/\"/g, '\\"')
                $.ajax({
                    type: 'post',
                    url: basePath + '/proTrack/save',  //请求数据接口
                    async: false,
                    data: {
                        bodyStr: str,
                        submitType: type
                    },
                    success: function (result) {
                        if (result.success) {
                            that.$message({
                                message: result.msg,
                                type: 'success'
                            });
                        } else {
                            that.$message.error(result.msg);
                        }
                    }
                });
            },
            queryProcessList() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/historyProcess/processList',  //请求数据接口
                    data: {processId: that.processId},
                    success: function (result) {
                        if (result.entity) {
                            that.procNodeList = result.entity.procNodeList;
                            that.tempNodeList = result.entity.tempNodeList;
                        }
                    }
                });
            },
            audit(status) {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/proTrack/auditProcess',  //请求数据接口
                    async: false,
                    data: {
                        id: that.id,
                        processId: that.processId,
                        status: status,
                        auditMsg: that.auditMsg,
                        isTrack: that.info.isTrack,
                    },
                    success: function (result) {
                        if (result.success) {
                            that.$message({
                                message: '操作成功',
                                type: 'success'
                            });
                        } else {
                            that.$message.error(result.msg);
                        }
                    }
                });
            }
        }
    })
</script>
</body>
</html>

